package org.keyroy.mapEditor.ui.views;

import org.eclipse.jface.action.Action;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.FormAttachment;
import org.eclipse.swt.layout.FormData;
import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.layout.RowLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.wb.swt.SWTResourceManager;
import org.keyroy.mapEditor.ui.beans.UIManage;

public class ShowConfigView extends Composite {

	/**
	 * Create the composite.
	 * 
	 * @param parent
	 * @param style
	 */
	public ShowConfigView(Composite parent,final Action action) {
		super(parent, SWT.NONE);
		setLayout(new FormLayout());

		Composite composite = new Composite(this, SWT.NONE);
		FormData fd_composite = new FormData();
		fd_composite.top = new FormAttachment(0, 10);
		fd_composite.left = new FormAttachment(0, 10);
		fd_composite.bottom = new FormAttachment(0, 290);
		fd_composite.right = new FormAttachment(0, 440);
		composite.setLayoutData(fd_composite);
		RowLayout rl_composite = new RowLayout(SWT.VERTICAL);
		rl_composite.wrap = false;
		composite.setLayout(rl_composite);

		Button button = new Button(composite, SWT.CHECK);
		button.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				UIManage.IS_SHOW_MAP_TILES = ((Button) e.getSource()).getSelection();
				action.run();
			}
		});
		button.setSelection(true);
		button.setImage(SWTResourceManager.getImage(ShowConfigView.class, "/res/icons/default_persp.gif"));
		button.setText("\u663E\u793A\u5730\u677F\u56FE\u5C42");

		Button button_1 = new Button(composite, SWT.CHECK);
		button_1.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				UIManage.IS_SHOW_TILES_OVERLAY = ((Button) e.getSource()).getSelection();
				action.run();
			}
		});
		button_1.setSelection(true);
		button_1.setImage(SWTResourceManager.getImage(ShowConfigView.class, "/res/icons/elements_obj.gif"));
		button_1.setText("\u663E\u793A\u5EFA\u7B51\u56FE\u5C42");

		Button button_2 = new Button(composite, SWT.CHECK);
		button_2.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				UIManage.IS_SHOW_POINT_OBJECT = ((Button) e.getSource()).getSelection();
				action.run();
			}
		});
		button_2.setSelection(true);
		button_2.setImage(SWTResourceManager.getImage(ShowConfigView.class, "/res/icons/targetpublic_obj.gif"));
		button_2.setText("\u663E\u793A\u70B9\u9635\u56FE\u5C42");

		Button button_3 = new Button(composite, SWT.CHECK);
		button_3.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				UIManage.IS_SHOW_LINE_OBJECT = ((Button) e.getSource()).getSelection();
				action.run();
			}
		});
		button_3.setSelection(true);
		button_3.setImage(SWTResourceManager.getImage(ShowConfigView.class, "/res/icons/disconnect_co(1).gif"));
		button_3.setText("\u663E\u793A\u7EBF\u9635\u56FE\u5C42");

		Button button_4 = new Button(composite, SWT.CHECK);
		button_4.addSelectionListener(new SelectionAdapter() {
			@Override
			public void widgetSelected(SelectionEvent e) {
				UIManage.IS_SHOW_AREA_OBJECT = ((Button) e.getSource()).getSelection();
				action.run();
			}
		});
		button_4.setSelection(true);
		button_4.setImage(SWTResourceManager.getImage(ShowConfigView.class, "/res/icons/empty_logical_package_obj.gif"));
		button_4.setText("\u663E\u793A\u533A\u57DF\u56FE\u5C42");

	}
	

}
